/*
 * Powered By [pkuWx]
 * Web Site: http://www.wuxi.ss.pku.edu.cn
 * Since 2015 - 2015
 */

package cn.edu.pku.wxlib.user.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.*;

import cn.edu.pku.wxlib.adminuser.model.Adminuser;
import cn.edu.pku.wxlib.user.dao.UserDao;
import cn.edu.pku.wxlib.user.model.*;
import cn.edu.pku.wxlib.user.service.*;
import cn.edu.pku.wxlib.user.vo.query.*;
import cn.edu.pku.wxlib.vo.response.StudentUser;
import cn.edu.pku.wxlib.vo.response.TeacherUser;
import javacommon.base.*;
import javacommon.util.*;
import javacommon.page.Page;

/**
 * @version 1.0
 * @since 1.0
 */

@Service
@Transactional
public class UserManager extends BaseManager<User,UserQuery,java.lang.Integer> implements UserService{
	
	@Autowired
	private UserDao userDao;
	public void setUserDao(UserDao dao) {
		this.userDao = dao;
	}
	public EntityDao getEntityDao() {
		return this.userDao;
	}
	
	@Transactional(readOnly=true)
	public Page findPage(UserQuery query) {
		return userDao.findPage(query);
	}
	
	//改变用户状态
	public void changeState(final Object... params) {
		userDao.changeState(params);
	}
	public void saveStudentUser(StudentUser user) {
		userDao.saveStudentUser(user);
	}
	public void saveTeacherUser(TeacherUser user) {
		userDao.saveTeacherUser(user);
	}
}
